﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ComponentModel.DataAnnotations;

namespace Headlight.Model
{
	public class Contact
	{
		public int ContactID { get; set; }

		[Required(ErrorMessage = "*")]
		public string FirstName { get; set; }

		[Required(ErrorMessage = "*")]
		public string LastName { get; set; }

		[Required(ErrorMessage = "Required.")]
		public string Address { get; set; }

		[Required(ErrorMessage = "Required.")]
		public string City { get; set; }

		[Required(ErrorMessage = "Required.")]
		public string State { get; set; }

		[Required(ErrorMessage = "Required.")]
		[RegularExpression(@"\d{5}(-\d{4})?", ErrorMessage = "Invalid Zip Code. Must have 5 digits")]
		public string ZipCode { get; set; }

		[Required(ErrorMessage = "Required.")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-zA-Z0-9]{1}[a-zA-Z0-9\-]{0,62}[a-zA-Z0-9]{1})|[a-zA-Z])\.)+[a-zA-Z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$", ErrorMessage = "Invalid Email")]
		public string Email { get; set; }

		[Required(ErrorMessage = "Required.")]
        [DataType(DataType.PhoneNumber)]
        public string PrimaryPhone { get; set; }

		public int DriverID { get; set; }
	}
}